#include <iostream>
using std::cout;
using std::endl;

template <class T>
T add(T t1, T t2)
{
    cout << "T class" << endl;
    return t1 + t2;
}

template <class T1, class T2>
T1 add(T1 t1, T2 t2)
{
    cout << "T1,T2" << endl;
    return t1 + t2;
}


template <class T1, class T2, class T3>
T1 add(T1 t1, T2 t2, T3 t3)
{
    cout << "T1,T2,T3" << endl;
    return t1 + t2 + t3;
}

void test0(){
    double x = 1.2;
    double y = 2.9;
    int z = 11;
    cout << add(x,y) << endl;
    cout << add(x,z) << endl;
    cout << add(z,x) << endl;
    cout << add(x,y,z) << endl;
    cout << add(z,x,y) << endl;
}

int main(void){
    test0();
    return 0;
}
